<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="/common/taglibs.jsp"%>

<div id="wish_view_c" class="wish_view">
<c:if test="${not empty wish}">
	<c:if test="${wish.reply == 1}">
	<div class="wish_tit">
		<center>
		<a style="text-decoration:underline;color:#F00;height:50px;font-size:20px;" id="a_wish_reply_top" href="javascript:followWish(${wish.wishid})">祝福</a>
		<br/>
		<a href="javascript:copyToClipBoard('/wish/index.do?wtid=${wtid}&wid=${wid}')">复制链接地址</a>
		</center>
	</div>
	</c:if>
	<div style="width:100%;border-bottom:2px solid #EF75AE;font-size:15px;background:#FFDDDD;">
		<font color="#ed2f4d">
		<strong>
		<ms:user userid="${wish.userid}" type="gnickname"></ms:user>(许愿)：
		</strong>
		</font>
		<c:out value="${wish.content}"/>
	</div>
	<c:if test="${not empty replies}">
		<c:forEach var="wishReplyx" items="${replies}">
			<div style="width:100%;border-bottom:2px dashed #AE75EF;font-size:13px;" id="wishreply_${wishReplyx.replyid}">
			<font color="#ed2f4d">
			<strong>
			<ms:user userid="${wishReplyx.userid}" type="gnickname"></ms:user>(祝福)：
			</strong>
			</font>
			<c:out value="${wishReplyx.content}"/>
			<br/>
			<c:if test="${wish.userid == userid}">
				<a href="javascript:removeWishReply(${wishReplyx.replyid})">删除</a>
			</c:if>
			</div>
		</c:forEach>
		<c:if test="${wdex>1}">
			<a href="javascript:showWish(${wish.wishid},${wdex-1})">上页</a>&nbsp;&nbsp;
		</c:if>
		<c:if test="${fn:length(replies)==5}">
			<a href="javascript:showWish(${wish.wishid},${wdex+1})">下页</a>
		</c:if>
	</c:if>
</c:if>
<c:if test="${empty wish}">
</c:if>
</div>
<script>
function followWish(wid){
	var isLogin = '<c:out value="${isLogin}"/>';
	if(isLogin == 'false'){
		alert("请登录");
		return;
	}
	$.fn.colorbox({
		 transition:"elastic",
		 width:"400px", 
		 height:"400px",
		 scrolling:false,
		 close:"关闭",
		 href:ctx +"/wish/toreply.do?wid="+wid
		 });
}
function removeWishReply(replyid){
	var dataarray = {};
	dataarray['replyid'] = replyid;
	$.ajax({
		url:ctx + "/wish/removereply.do", 
		type:"POST", 
		data:dataarray, 
		dataType:"html", 
		timeout:20000, 
		error:function () {
		}, 
		success:function (html) {
		}
	});
	showWish(${wish.wishid});
}
</script>